# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

require 'rubocop/rake_task'

RuboCop::RakeTask.new

task default: %i[spec]

Rake::Task['release'].clear
gemspec = Bundler.load_gemspec(Dir.glob('*.gemspec').first)
desc "Build and push #{gemspec.name}-#{gemspec.version}.gem to rubygems.org\n" \
     'To prevent publishing in RubyGems use `gem_push=no rake release`'
task 'release', [:remote] => ['build', 'release:guard_clean', 'release:rubygem_push'] do # rubocop:disable Lint/EmptyBlock
end
